﻿using System;
using System.Collections.Generic;

using System.Text;

namespace DTO
{

    public class Device : BaseDTO
    {
        #region Fields
        #endregion

        #region Properties
        public string Name { get; set; }
        public string FriendlyName { get; set; }
        public double Fee  { get; set; }
        public DateTime RentFromDate { get; set; }
        public DateTime RentToDate { get; set; }
        public string RAM { get; set; }
        public string CPU { get; set; }
        public string Bandwidth { get; set; }
        public string DiskQuota { get; set; }
        public PlanType Plan { get; set; }
        public OperatingSystem OS { get; set; }
        public string DeviceType { get; set; }
        public string IP { get; set; }
        public User user { get; set; }
        public string DeviceIdType { get; set; }
        public DateTime RequestDate { get; set; }
        public int RequestStatus { get; set; }
        public string RequestStatusName { get; set; }
        public Firewall Firewall { get; set; }
        public Customer Customer { get; set; }
        public bool IsCustom { get; set; }
        public string Notes { get; set; }
        public bool IsCheck { get; set; }
        #endregion

        #region Constructors
        public Device () : this(0) { }
        public Device (int id) : base(id)
        {
        }        
        #endregion

        #region Private Methods
        #endregion

        #region Public Methods

        #endregion

        public class PlanType : BaseDTO
        {
            #region Fields
            #endregion

            #region Properties
            public string Name { get; set; }
            public string CPUs { get; set; }
            public string RAM { get; set; }
            public string Price { get; set; }
            public string DiskQuota { get; set; }
            public string Bandwidth { get; set; }
            public double MonthlyFee { get; set; }
            public double ProratedFee { get; set; }
            public int SpecificationId { get; set; }

            #endregion

            #region Constructors
            public PlanType () : this(0) { }
            public PlanType ( int id )
                : base(id)
            {
            }        
            #endregion

            #region Private Methods
            #endregion

            #region Public Methods
            
            #endregion
        }

        public class OperatingSystem : BaseDTO
        {
            #region Fields
            #endregion

            #region Properties
            public string Name { get; set; }
            public double Fee { get; set; }
            #endregion

            #region Constructors
            public OperatingSystem () : this(0) { }
            public OperatingSystem ( int id ) : base(id) { }        
            #endregion

            #region Private Methods
            #endregion

            #region Public Methods
            public static OperatingSystem Sample (int index)
            {
                OperatingSystem os = null;

                switch (index)
                {
                    case 1:
                        os = new OperatingSystem(1){ Name = "Windows 2003 R2 - Standard - 32 Bit" };
                        break;
                    case 2:
                        os = new OperatingSystem(1) { Name = "Windows 2003 R2 - Standard - 64 Bit" };
                        break;
                    case 3:
                        os = new OperatingSystem(1) { Name = "Windows 2008 R2 - Standard - 32 Bit" };
                        break;
                    case 4:
                        os = new OperatingSystem(1) { Name = "Windows 2008 R2 - Standard - 64 Bit" };
                        break;
                    case 5:
                        os = new OperatingSystem(1) { Name = "Windows 2008 R2 - Standard - 64 Bit - IIS 7.5" };
                        break;
                }

                return os;
            }
            #endregion
       }

        public class CPUs : BaseDTO
        {
            #region Properties

            public string Name { get; set; }
            public string Price { get; set; }
            public string Specification { get; set; }
            public string Details { get; set; }

            #endregion

            #region Constructors

            public CPUs () : this(0) { }
            public CPUs(int id) : base(id) { }  
      
            #endregion

            #region Public Methods
            public override string ToString ()
            {
                return this.Name + " ( $ " + this.Price + "/" + this.Specification + " )";
            }
            #endregion
        }

        public class Memory : BaseDTO
        {
            #region Properties

            public string Name { get; set; }
            public string Price { get; set; }
            public string Specification { get; set; }
            public string Details { get; set; }

            #endregion

            #region Constructors

            public Memory() : this(0) { }
            public Memory(int id) : base(id) { }

            #endregion

            #region Public Methods
            public override string ToString ()
            {
                return this.Name + " ( $ " + this.Price + "/" + this.Specification + " )";
            }
            #endregion
        }

        public class Specification : BaseDTO
        {
            #region Properties

            public string Name { get; set; }

            #endregion

            #region Constructors

            public Specification() : this(0) { }
            public Specification(int id) : base(id) { }

            #endregion
        }

        public class DiskSpace : BaseDTO
        {
            #region Properties

            public string Name { get; set; }
            public string Price { get; set; }
            public string Specification { get; set; }
            public string Details { get; set; }

            #endregion

            #region Constructors

            public DiskSpace() : this(0) { }
            public DiskSpace(int id) : base(id) { }

            #endregion

            #region Public Methods
            public override string ToString ()
            {
                return this.Name + " ( $ " + this.Price + "/" + this.Specification + " )";
            }
            #endregion
        }

    }
}
